package com.example.myapplication.adapter;

import android.content.Context;


import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import java.util.ArrayList;

/**
 * Created by Administrator on 2020/12/15.
 */

public class Myadapter extends FragmentPagerAdapter {

    Context context;
    ArrayList fragmentList;

    public Myadapter(FragmentManager fm, Context context, ArrayList fragmentList) {
        super(fm);
        this.context = context;
        this.fragmentList = fragmentList;
    }

    public Myadapter(FragmentManager fm){
        super(fm);
    }

    @NonNull
    @Override
    public Fragment getItem(int position) {
        return (Fragment) fragmentList.get(position);
    }





    public int getCount() {
        return fragmentList.size();
    }
}